#ifndef __FILTER_H__
#define __FILTER_H__

#include <stdint.h>

typedef enum{
	flt_none=0,
  flt_am,     //算术平均
  flt_wra,    //加权递推平均
}Filter_enum;
typedef struct{
  uint16_t *psrc;    //源数据数组
  uint16_t *N;       //滤波次数
  uint16_t *mode;    //滤波模式
   int16_t *offset;  //偏置
  uint16_t chmax;    //数组中数据通道数目
  uint16_t chnum;    //通道编号
  uint16_t inited;   //初始化标志
}Filter_t;


extern uint16_t FilterInit(Filter_t *p,uint16_t*s,uint16_t *N,uint16_t max,uint16_t num,uint16_t* mode,int16_t *offset);
extern uint16_t FilterArithmeticMean(Filter_t *p);
extern uint16_t FilterWeightedRecursiveAverage(Filter_t *p);

#endif
